VERSION 5.00
Begin VB.Form MaintenanceForm 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   12000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VCT.TouchKeyPad KeyPad 
      Height          =   4095
      Left            =   3360
      TabIndex        =   9
      Top             =   4440
      Width           =   3615
      _ExtentX        =   6376
      _ExtentY        =   7223
   End
   Begin VB.CommandButton Cancel_Button 
      BackColor       =   &H008080FF&
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   7560
      Width           =   1935
   End
   Begin VB.CommandButton Next_Button 
      Caption         =   "Set Code"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   5
      Top             =   6360
      Width           =   1935
   End
   Begin VB.CommandButton Clear_Button 
      Caption         =   "Clear"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   4
      Top             =   5160
      Visible         =   0   'False
      Width           =   1935
   End
   Begin VB.CommandButton SetNextCouplesCode_Button 
      Height          =   735
      Left            =   3540
      TabIndex        =   2
      Top             =   2520
      Width           =   855
   End
   Begin VB.CommandButton SetNextClientCode_Button 
      Height          =   735
      Left            =   3540
      TabIndex        =   0
      Top             =   1320
      Width           =   855
   End
   Begin VB.Label NextClientCode_Label 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Next Client Code:"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   840
      TabIndex        =   13
      Top             =   1500
      Width           =   2055
   End
   Begin VB.Label NextCouplesCode_Label 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      Caption         =   "Next Couple Code:"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   840
      TabIndex        =   12
      Top             =   2280
      Width           =   2055
   End
   Begin VB.Label NextClientCode_Data 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   1080
      TabIndex        =   11
      Top             =   1860
      Width           =   1875
   End
   Begin VB.Label NextCouplesCode_Data 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   1080
      TabIndex        =   10
      Top             =   2640
      Width           =   1875
   End
   Begin VB.Label CouplesCode_Data 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   8580
      TabIndex        =   8
      Top             =   2640
      Width           =   2655
   End
   Begin VB.Label ClientCode_Data 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   8580
      TabIndex        =   7
      Top             =   1500
      Width           =   2655
   End
   Begin VB.Shape CouplesCodeBox 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   1  'Opaque
      BorderWidth     =   2
      FillColor       =   &H00FFFFFF&
      Height          =   735
      Left            =   8460
      Shape           =   4  'Rounded Rectangle
      Top             =   2520
      Width           =   3015
   End
   Begin VB.Shape ClientCodeBox 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   1  'Opaque
      BorderWidth     =   2
      FillColor       =   &H00FFFFFF&
      Height          =   735
      Left            =   8460
      Shape           =   4  'Rounded Rectangle
      Top             =   1380
      Width           =   3015
   End
   Begin VB.Label Label1 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Change Next Couples Code"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   4620
      TabIndex        =   3
      Top             =   2640
      Width           =   3735
   End
   Begin VB.Label Menu2_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Change Next Client Code"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   4620
      TabIndex        =   1
      Top             =   1500
      Width           =   3735
   End
   Begin VB.Shape Shape3 
      BackColor       =   &H00E0E0E0&
      BackStyle       =   1  'Opaque
      BorderWidth     =   2
      Height          =   1935
      Left            =   600
      Top             =   1320
      Width           =   2595
   End
End
Attribute VB_Name = "MaintenanceForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Cancel_Button_Click()
   RegMenuForm.Show
   Unload Me
End Sub

Private Sub Form_Load()
   If NextClientCode = 0 Then
      NextClientCode_Data.Caption = "Not Set"
   Else
      NextClientCode_Data.Caption = NextClientCode
   End If
   
   If NextCoupleCode = 0 Then
      NextCouplesCode_Data.Caption = "Not Set"
   Else
      NextCouplesCode_Data.Caption = NextCoupleCode
   End If
   ClientCodeBox.Visible = False
   CouplesCodeBox.Visible = False
   ClientCode_Data.Caption = ""
   CouplesCode_Data.Caption = ""
   KeyPad.Visible = False
   Next_Button.Enabled = False
End Sub

Private Sub KeyPad_NumPressed()
   If ClientCodeBox.Visible = True Then
      ClientCode_Data.Caption = ClientCode_Data.Caption & KeyPad.KeyNum
   Else
      CouplesCode_Data.Caption = CouplesCode_Data.Caption & KeyPad.KeyNum
   End If
End Sub

Private Sub Next_Button_Click()
   If ClientCodeBox.Visible = True Then
      NextClientCode = ClientCode_Data.Caption
   Else
      NextCoupleCode = CouplesCode_Data.Caption
   End If
   
   'Update the record in the CODES table
   CnUser.Open ConnectString
   Cmd.CommandText = "UPDATE codes SET CLIENT_CODE = " & NextClientCode & ", COUPLE_Code = " & NextCoupleCode
   Cmd.CommandType = adCmdText
   Cmd.ActiveConnection = CnUser
   Cmd.Execute
   CnUser.Close
   
   RegMenuForm.Show
   Unload Me

End Sub

Private Sub SetNextClientCode_Button_Click()
   SetNextClientCode_Button.Enabled = False
   SetNextCouplesCode_Button.Enabled = False
   ClientCodeBox.Visible = True
   KeyPad.Visible = True
   Next_Button.Enabled = True
End Sub

Private Sub SetNextCouplesCode_Button_Click()
   SetNextClientCode_Button.Enabled = False
   SetNextCouplesCode_Button.Enabled = False
   CouplesCodeBox.Visible = True
   KeyPad.Visible = True
   Next_Button.Enabled = True
End Sub
